<div class='item'>
  <div class='img'>
    <%= image_tag 'money/gift.png', :size => '105x78' %>
  </div>
  <div class='text'>
    <div class='line1'>
      <%= gift.title %>
    </div>
    <div class='line2'>
      <b>礼包说明：</b><%= sanitize_all gift.content %>
    </div>
  </div>
  <div class='remark'>
    <% if feed.present? %>
    <div>
      完成于<%= time_ago_in_words feed.created_at, false %>前
    </div>
    <div>
      已获得麦粒：<b><%= gift.money %></b>    
    </div>
    <% else %>
    <div>
      可获得麦粒：<b><%= gift.money %></b>    
    </div>
    <% end %>
  </div>
  <div id='gift_<%= gift.id %>_tools' class='tools'>
    <% if feed.present? %>    
    <%= link_to_function '已经领取','', :class => 'corner done' %>
    <% else %>
    <%= link_to_remote '立即领取', 
          :update => 'earning',
          :url => draw_gift_money_url(gift), 
          :method => :put,
          :loading => "#{small_loading("gift_#{gift.id}_tools")}",
          :html => {
            :class => :corner
          } %>
    <% end %>
  </div>
  <% if feed.nil? %>
  <dl id="gift_feeds" class='feeds'>
    <dt>近期：</dt>
    <% Feed::MoneyGift.all(:order => 'created_at desc', :limit => 20).each_with_index do |feed, index| %>
    <dd class='feed' style='<%= index == 0 ? '' : 'display:none' %>'><%= feed_to_html feed %></dd>
    <% end %>
  </dl>
  <script type="text/javascript" charset="utf-8">
    setInterval("next_feed('gift_feeds')",5000);
  </script>
  <% end %>
</div>